home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / admin / Rdist < prev   
Text File  |  1992-08-11  |  1KB  |  40 lines

  1. #! /sprite/cmds/csh -fb
  2. #
  3. # This file rdists the entire Sprite file system and is invoked
  4. # nightly by crontab.
  5. #
  6. # $Header: /sprite/admin/RCS/Rdist,v 1.3 92/08/11 12:53:04 jhh Exp $
  7.  
  8. set path = (/sprite/cmds)
  9.  
  10. echo -n "Rdist started: "; date
  11. set distfile=(/sprite/admin/distfile)
  12.  
  13. # Address to send error messages to
  14. set admin=jhh
  15.  
  16. set targets=(kernel include)
  17.  
  18. # First make a dry run through to make sure the distfile is
  19. # acceptable.
  20. rdist -n -f $distfile $targets > /dev/null
  21. if ($status != 0) then
  22.     echo "Error in $distfile."
  23.     echo "Error in $distfile." | Mail -s "distfile problem" $admin
  24. else
  25. # The dry run worked.
  26. # Rdist each target individually to get around a bug that is causing
  27. # rdist to die.  Maybe.
  28.     foreach target ($targets)
  29.         echo "rdist $target"
  30.         rdist -f $distfile $target | grep -v "updated" | \
  31.                                      grep -v "Warning: remote mode"
  32.     if ($status != 0) then
  33.         echo "Please check /sprite/admin/Rdist.log." | \
  34.             Mail -s "rdist of $target failed" $admin
  35.     endif
  36.     end
  37. endif    
  38. echo -n "Rdist completed: "; date
  39.  
  40.